home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Georgia Wildfire Prevention
/
Georgia Wildfire Prevention.iso
/
pc
/
media
/
dirs
/
BackUp
/
WildFire.dir
/
00008_Script_AnswerGod
< prev
next >
Wrap
Text File
|
2002-10-15
|
919b
|
27 lines
--ANSWER GOD--
property QuestionList
on new me
return me
end
--This handler causes the object to check which questions are available and asks one at random.
on AskQuestion me
QuestionList = []
sendallsprites (#AvailableQuestions)
set TotalQuestions = count(QuestionList) --Counts the number of elements in the question list.
set RandomQuestion = random(TotalQuestions) --Using the number of elements, a random one is picked.
if QuestionList <> [] then
set NextQuestion = getat(QuestionList, RandomQuestion) --Sets NestQuestion equal to the SpNum of the question.
sendallsprites(#LightsOut, NextQuestion) --Tells the question to appear.
updatestage
else
go next
end if
end
--This function takes the questions availibilty response and stores it in the QuestionList.
on AvailabilityResponse me, AvailableQuestion
add (QuestionList, AvailableQuestion)
end